<?php 
//error_reporting(0);
$isadmin=1;
include "../../comm/tuaninc.php";
include('../check.php');
$sql="select catename from ".$duoduo->BIAOTOU."catelist order by sortorder desc";
$query=$duoduo->query($sql);
while($row=$duoduo->fetch_array($query)){
    $cat_arr[$row['catename']]=$row['catename'];
}
if($_POST['Submit']){
	$tgopen=$_POST['webset']['tgopen'];
	$sql="update ".$duoduo->BIAOTOU."websetting set tgopen='".$tgopen."' where Id=1";
	$query=$duoduo->query($sql);
    $field_arr=$_POST['info'];
	foreach($field_arr as $k=>$v){
		if($k=='lasttime'){
		    $v=strtotime($v);
		}
	    $sql="update ".$duoduo->BIAOTOU."setting set val='$v' where var='$k' limit 1";
		$query=$duoduo->query($sql);
	}
	admin_log('保存团购设置');
	$duoduo->alert('保存完成');
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理中心</title>
<link href="../css/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
table,tr,td { font-size:12px;}
table a { text-decoration:none; color:#FF6600}
table a:visted { color:#FF66CC; text-decoration:none}
.STYLE1 {color: #FF6600}
-->
</style>
</head>
<body topmargin="5" leftmargin="0">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" >
  <tr>
    <td height="282" valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td>
          <table cellspacing="0" width="100%" height="207" style="border:1px  solid #DCEAF7;">
            <tr>
              <td height="30" colspan="2" bgcolor="E9F2FB" class="bigtext"><strong>&nbsp;<img src="../images/arrow.gif" width="16" height="22" align="absmiddle" /> 团购基本信息设置</strong></td>
            </tr>
            <tr>
              <td width="100%" colspan="2" valign="top"><table width="100%" height="300" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td valign="top" style=" padding-top:3px">
                  <form id="form1" name="form1" method="post" action="">
                    <table width="100%"  align="center" border=1 cellpadding=0 cellspacing=0
style="border-collapse: collapse" bordercolor="#dddddd">
					 
                     <tr>
                        <td height="30" align="right" class="bigtext">团购模块：</td>
                        <td height="30" class="bigtext">&nbsp;
                        <label><input value="1" type="radio" name="webset[tgopen]" <?php if(TGOPEN==1){?> checked="checked"<?php }?> />开启</label>&nbsp;&nbsp;
                        <label><input value="0" type="radio" name="webset[tgopen]" <?php if(TGOPEN==0){?> checked="checked"<?php }?> />关闭</label>
                        
                          </td>
                      </tr>
                     
					  <tr>
                        <td height="30" align="right" class="bigtext">采集密钥：</td>
                        <td height="30" class="bigtext">&nbsp;
                          <input name="info[DDKEY]" type="text" id="DDKEY" value="<?=DDKEY?>" style="width:100px" />
                          &nbsp;(任意数字或者字母，防止恶意触发采集，占用系统资源)</td>
                      </tr>
                      <tr>
                        <td height="30" align="right" class="bigtext">默认分类：</td>
                        <td height="30" class="bigtext">&nbsp;
                        <?php $duoduo->select($cat_arr,'info[DECATNAME]',DECATNAME)?>
                          &nbsp;(如果商品不符合现有分类，将自动归于此类)</td>
                      </tr>
                      <tr>
                        <td height="30" align="right" class="bigtext">采集间隔：</td>
                        <td height="30" class="bigtext">&nbsp;
                        
                        <select name="info[SITE_GATHER_AUTO_TIME]">
                        <?php for($i=1;$i<=24;$i++){?>
                        <option value="<?=$i?>" <?php if($i==SITE_GATHER_AUTO_TIME){?> selected="selected"<?php }?>><?=$i?></option>
                        <?php }?>
                        </select>
                          &nbsp;(自动采集的间隔时间，单位小时)
                          </td>
                      </tr>
                      <tr>
                        <td height="30" align="right" class="bigtext">上次采集时间：</td>
                        <td height="30" class="bigtext">&nbsp;
                        <input name="info[lasttime]" type="text" id="lasttime" value="<?=date('Y-m-d H:i:s',$lasttime)?>" style="width:200px" />
                          &nbsp;(上次采集的时间，可改成 1 保存，打开团购首页会触发自动采集)</td>
                      </tr>
                      <tr>
                        <td height="30" align="right" class="bigtext">删除过期数据：</td>
                        <td height="30" class="bigtext">&nbsp;
                        <label><input value="1" type="radio" name="info[GOODS_DEL_AUTO]" <?php if(GOODS_DEL_AUTO==1){?> checked="checked"<?php }?> />是</label>&nbsp;&nbsp;
                        <label><input value="0" type="radio" name="info[GOODS_DEL_AUTO]" <?php if(GOODS_DEL_AUTO==0){?> checked="checked"<?php }?> />否</label>
                          &nbsp;(自动删除过期团购商品)
                          </td>
                      </tr>
                      <tr>
                        <td height="30" align="right" class="bigtext">首页显示个数：</td>
                        <td height="30" class="bigtext">&nbsp;
                          <input name="info[SHOWNUM]" type="text" id="SHOWNUM" value="<?=SHOWNUM?>" style="width:100px" /> 
                          &nbsp;(首页每个栏目显示的商品个数，根据模板，3的倍数)</td>
                      </tr>
                      <tr>
                        <td height="30" align="right" class="bigtext">列表页显示个数：</td>
                        <td height="30" class="bigtext">&nbsp;
                          <input name="info[LISTNUM]" type="text" id="LISTNUM" value="<?=LISTNUM?>" style="width:100px" /> 
                          &nbsp;(列表页显示的商品个数，根据模板，3的倍数)</td>
                      </tr>
                      <tr>
                        <td height="30" align="right" class="bigtext">团购ID：</td>
                        <td height="30" class="bigtext">&nbsp;
                          <input name="info[TUANCID]" type="text" id="TUANCID" value="<?=TUANCID?>" style="width:100px" /> 
                          &nbsp;(团购栏目的代码号)</td>
                      </tr>
                      <!--<tr>
                        <td height="30" align="right" class="bigtext">搜索关键词：</td>
                        <td height="30" class="bigtext">&nbsp;
                          <input name="info[hot_words]" type="text" id="hot_words" value="<?=$hot_words?>" style="width:300px" /> 
                          &nbsp;(用“|”符号隔开)</td>
                      </tr>-->
                      <tr><td align="right" class="bigtext">注意：</td><td style="color:#F00">&nbsp;网站基本设置中的网站网址必须填写</td></tr>
                      <tr>
                        <td height="30" align="right">&nbsp;</td>
                        <td height="30" class="bigtext">&nbsp;
                          <input type="submit" name="Submit" value=" 保 存 设 置 " />
                          </td>
                      </tr>
                    </table>
                    <br />
                  </form>
                  </td>
                </tr>
              </table></td>
            </tr>
          </table></td>
        </tr>
      
    </table></td>
  </tr>
</table>
</div>
<script src="../js/jquery.js" type="text/javascript"></script>
<script src="../js/facebox.js" type="text/javascript"></script>
<link href="../js/facebox.css" media="screen" rel="stylesheet" type="text/css" />
<script type="text/javascript">
    jQuery(document).ready(function($) {
      $('a[rel*=facebox]').facebox() 
    })
</script>
<div id="mydiv" style="display:none; font:12px; color:#666666;">
<br/>您好！若需增加商城返现必须要注册联盟账号，为了更多分享我们官方特别优惠<br/>强烈建议<span style="font-size:14px; color:#FF0000; font-weight:bold">推荐人写 “ duoduo123 ”</span>你们将可获得与我们官方同级别优惠待遇。<br/><br/>
&nbsp;&nbsp;&nbsp; <a href="http://www.linktech.cn/home/linktech_affil_join08.htm" target="_blank">知道了，立刻注册</a><br/>
<br/>我们的领客特账号为<span style="font-size:12px; color:#FF0000; font-weight:bold">duoduo123 </span>
</div>
<div id="mydiv_yqf" style="display:none; font:12px; color:#666666;">
<br/>您好！若需增加商城返现必须要注册联盟账号，为了更多分享我们官方特别优惠。<br/>强烈建议<span style="font-size:14px; color:#FF0000; font-weight:bold">推荐人写 “ 多多返利 ”</span>你们将可获得与我们官方同级别优惠待遇。<br/><br/>
&nbsp;&nbsp;&nbsp; <a href="http://www.yiqifa.com/userRegEdit.do?regType=earner" target="_blank">知道了，立刻注册</a><br/>
<br/>我们的亿起发账号为<span style="font-size:12px; color:#FF0000; font-weight:bold">多多返利 </span>
</div>
</body>
</html>
